package com.yaoxiaoqing.objectclass;

public class ArrayPrint {
    public static void main(String[] args) {
        test();
    }
    public static void test(){
        int[] arr = new int[10];
        System.out.println(arr);//地址值

        char[] arr1 = new char[10];
        System.out.println(arr1);//单独打印没有显示,即显示为空
        System.out.println("---"+arr1);//---[C@380fb434 地址值

        int[] arr2 = new int[]{1, 2, 3};
        System.out.println(arr2);

        char[] arr3 = new char[]{'a', 'b', 'c'};
        // //传进去的是一个数组，里面遍历数据了
        System.out.println(arr3);//abc
        System.out.println("---"+arr3);//---[C@3cda1055
    }
}
class Circle1{
    double radius;//半径

    public double findArea(){
        return radius * radius * Math.PI;
    }
}

class PassObject{
    public static void main(String[] args) {
        PassObject test = new PassObject();

        Circle1 c = new Circle1();
        test.printAreas(c, 5);

        System.out.println("当前半径值" + c.radius);
    }
    public void printAreas(Circle1 c,int time){
        System.out.println("半径 面积");
        for (int i = 1; i <= time; i++) {
            c.radius = i;
            System.out.println(c.radius + "\t\t" + c.findArea());
        }
        //重新赋值
        c.radius = time + 1;
    }
}

